<script setup>
import { RouterLink, RouterView } from 'vue-router'

const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-row class="tac">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
          >
            <el-sub-menu index="1">
              <template #title>
                <el-icon><location /></el-icon>
                <span>各个评分段词云图</span>
              </template>
              <el-menu-item index="/echart1">评分1-2评论的词云图</el-menu-item>
              <el-menu-item index="/echart2">评分2-3评论的词云图</el-menu-item>
              <el-menu-item index="/echart3">评分3-4评论的词云图</el-menu-item>
              <el-menu-item index="/echart4">评分4-5评论的词云图</el-menu-item>
            </el-sub-menu>

            <el-sub-menu index="1">
              <template #title>
                <el-icon><location /></el-icon>
                <span>各个评分段直方图</span>
              </template>
              <el-menu-item index="/zd1">评分1-2前十个高频词</el-menu-item>
              <el-menu-item index="/zd2">评分2-3前十个高频词</el-menu-item>
              <el-menu-item index="/zd3">评分3-4前十个高频词</el-menu-item>
              <el-menu-item index="/zd4">评分4-5前十个高频词</el-menu-item>
            </el-sub-menu>

            <el-menu-item index="/commentCount">
              <el-icon><setting /></el-icon>
              <span>各个区间评论数分布</span>
            </el-menu-item>
            
            <el-menu-item index="/zft">
              <el-icon><setting /></el-icon>
              <span>直方图</span>
            
            </el-menu-item>
            <el-sub-menu index="1">
              <template #title>
                <el-icon><location /></el-icon>
                <span>头部商家直方图</span>
              </template>
              <el-menu-item index="/commentTop20">评论数前二十商家</el-menu-item>
              <el-menu-item index="/ratingTop20">评分前二十商家</el-menu-item>
            </el-sub-menu>
            

          </el-menu>
        </el-row>
      </el-aside>
      <el-container>
        <el-header>图片展示如下</el-header>
        <el-main>
          <RouterView></RouterView>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style scoped>
.common-layout {
  width: 100%;
  height: 100%;
  .el-header,
  .el-footer,
  .el-main,
  .el-aside {
    display: flex;
    justify-content: center;
    align-items: center;
    /* height: 100%; */
  }

  .el-header,
  .el-footer {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--el-text-color-primary);
    text-align: center;
  }

  .el-aside {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--el-text-color-primary);
    text-align: center;
    flex-direction: column;
    justify-content: flex-start;
  }

  .el-main {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--el-text-color-primary);
    text-align: center;

    height: 100%;
  }

  .el-container {
    height: 100%;
  }
}
</style>
